import { createStore } from 'vuex' 

interface UserProps {
  isLogin: boolean,
  name?: string,
  id?: number,
  token?:string
}
export interface GlobalDataProps {
  user:UserProps
}
const store = createStore<GlobalDataProps>({
  state: {
    user: { isLogin: false, name: 'xiaojun' }
  },
  mutations: {
    login(state) {
      state.user = {...state.user,isLogin:true,name:'xiaojun'}
    },
  },
  getters: {

  }
})

export default store